#include <QtGui>
#include "room.h"

RoomDialog::RoomDialog(MainDialog *man)
{
    mdia=man;
    createMusicGroupBox();

    okButton = new QPushButton(tr("OK"));
    cancelButton = new QPushButton(tr("Cancel"));
    okButton->setDefault(true);

    connect(buttons[0], SIGNAL(clicked()), this, SLOT(choice()));

    QHBoxLayout *buttonLayout = new QHBoxLayout;
    buttonLayout->addStretch(1);
    buttonLayout->addWidget(okButton);
    buttonLayout->addWidget(cancelButton);
   
    QVBoxLayout *rightLayout =new QVBoxLayout;
    rightLayout->addWidget(musicGroupBox);
    

    
   
    
    QHBoxLayout *mainLayout = new QHBoxLayout;
    mainLayout->addLayout(rightLayout);
    setLayout(mainLayout);
    resize(600,400);
    setWindowTitle(tr("Radio Star"));
}
void RoomDialog::createIdGroupBox(){

    idGroupBox = new QGroupBox(tr("Id"));
    QVBoxLayout *layout =new QVBoxLayout;  
    
    idlistwidget = new QListWidget(this);
   
    layout->addWidget(idlistwidget);
   
    idGroupBox->setLayout(layout);
}

void RoomDialog::createMusicGroupBox()
{
    musicGroupBox = new QGroupBox(tr("Room"));
    QVBoxLayout *layout = new QVBoxLayout;

    buttons[0] = new QPushButton(tr("choice"));
    musiclistwidget = new QListWidget(this);
    


    layout->addWidget(musiclistwidget);
    layout->addWidget(buttons[0]);

    musicGroupBox->setLayout(layout);
}

void RoomDialog::createGridGroupBox()
{
    gridGroupBox = new QGroupBox(tr("chatting"));
    QGridLayout *layout = new QGridLayout;

 
    lineEdits = new QLineEdit;
    layout->addWidget(lineEdits,5,0);
   
   enterButton = new QPushButton(tr("input"));
   layout->addWidget(enterButton,5,1);    
     
    smallEditor = new QTextEdit;
    layout->addWidget(smallEditor,0,0,4,2);
    gridGroupBox->setLayout(layout);
}
void RoomDialog::input(){
}
void RoomDialog::choice()
{
 mdia->show();
 this->hide();
}


